<template>
	<view>

		<div class="big-box">
			<div>
				<img class='img' :src="zh[0].zhimg" alt="">
			</div>
			<div>
				<div style='margin-top: 10px; margin-top: 30px;'>{{zh[0].name}}</div>
				<div style='margin-top: 10px;' @click='dl()'>{{zh[0].text}}</div>

			</div>
			<text style="margin: 30px; margin-left: 100px; " v-if="tc==true" @click="tcdl()">退出登录</text>
		</div>


		<div class="box1">

			<div><text>{{zh[0].ye}}</text><br>账户余额</div>
			<div><text>{{zh[0].jf}}</text><br>积分</div>
			<div><text>{{zh[0].yhq}}</text><br>优惠券</div>

		</div>


		<div class='box2'>

			<div class="box"><img src="../../static/wode/订单.png" alt=""><br> <text>全部订单</text> </div>
			<div class="box"><img src="../../static/wode/待支付.png" alt=""><br> <text>待付款</text> </div>
			<div class="box"><img src="../../static/wode/代发货.png" alt=""><br> <text>待收货</text> </div>
			<div class="box"><img src="../../static/wode/收货icon.png" alt=""><br> <text>已收货</text> </div>

		</div>


		<div class='box3'>
			<view style="margin-left: 15px;margin-bottom: 15px;">我的服务</view>
			<div class='box'>

				<div @click='shdz()'>
					<img src="../../static/wode/收货地址.png" alt=""><br>
					<text>收货地址</text>
				</div>

				<div @click='lq()'>
					<img src="../../static/wode/领券中心.png" alt=""><br>
					<text>领劵中心</text>
				</div>

				<div>
					<img src="../../static/wode/我的－帮助中心.png" alt=""><br>
					<text>我的帮助</text>
				</div>

				<div>
					<img src="../../static/wode/售后.png" alt=""><br>
					<text>售后服务</text>
				</div>

			</div>

		</div>

	</view>
</template>


<script>
	export default {
		data() {
			return {
				tc: false,
				zh: [{
					zhimg: '../../static/wode/未登录头象.png',
					name: '未登录',
					text: '点击登录账户',
					ye: '--',
					jf: '--',
					yhq: '--'
				}]
			}
		},
		onShow() {
			const value = uni.getStorageSync('idid');
			if (value.length == 0) {

			} else {
				this.zh[0] = value
				this.tc=true
				console.log(this.zh)
			}

		},
		methods: {
			dl() {
				uni.navigateTo({
					url: './dl'
				});
			},
			tcdl(){
				uni.removeStorageSync("idid");
				this.tc=false
			},
			lq(){
				uni.navigateTo({
					url: '/pages/index/lqjx'
				});
			},
			shdz(){
				uni.navigateTo({
					url: '/pages/wode/shdz'
				});
			}
		}
	}
</script>

<style lang="scss">
	.big-box {
		background-color: aliceblue;
		display: flex;

		.img {
			width: 100px;
			border-radius: 90px;
			margin-right: 20px;
			margin-left: 18px;
		}
	}

	.box1 {
		height: 80px;

		display: flex;

		// border: 1px solid red;
		div {
			margin-left: 15px;
			margin: 0 auto;
			font-size: 20px;

			text {
				margin-left: 30%;
				font-size: 15px;

			}
		}
	}

	.box2 {
		// border: 1px solid red;
		margin-top: 10px;
		display: flex;

		.box {
			margin: 0 auto;
		}

		img {
			width: 30px;
			margin-left: 13px;
		}
	}

	.box3 {
		margin-top: 30px;

		.box {
			display: flex;
			justify-content: space-between;

			div {
				margin-left: 15px;
				margin-right: 10px;
			}
		}

		img {
			width: 30px;
			margin-left: 15px;
		}
	}
</style>
